package fdoj.eventInvitations.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="invantations")
public class Invantation implements Serializable{
	/**
	 *
	 */
	private static final long serialVersionUID = 4643922665595051769L;

	@Id
	@GeneratedValue(strategy=IDENTITY)
	@Column(name="invantation_id", unique=true, nullable=false)
	private Integer id;

	@Column(name="status", unique=false, nullable=false)
	private Response status;
	
	@Column(name="securityToken", unique=false, nullable=false)
	private String securityToken = UUID.randomUUID().toString();
	
	@ManyToOne
	@JoinColumn(name="eventCall_id", referencedColumnName="contact_id", nullable=false)
	private Contact eventCall;

	@ManyToOne
	@JoinColumn(name="event_id", referencedColumnName="event_id", nullable=false)
	private Event event;

	public Invantation(){

	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Response getStatus() {
		return status;
	}

	public void setStatus(Response status) {
		this.status = status;
	}

	public Contact getEventCall() {
		return eventCall;
	}

	public void setEventCall(Contact eventCall) {
		this.eventCall = eventCall;
	}

	public void setEvent(Event event) {
		this.event = event;
	}

	public Event getEvent() {
		return event;
	}

	public String getSecurityToken() {
		return securityToken;
	}

	public void setSecurityToken(String securityToken) {
		this.securityToken = securityToken;
	}

}
